<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8"/>
  <title>配置文件列表</title>
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css"/>
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css"/>
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/color.css"/>
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/demo/demo.css"/>
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>

</head>

<body class="easyui-layout">
<div data-options="region:'north',border:false" style="height:60px;background:#B3DFDA;padding:10px;text-align: center"><font size="4">配置文件信息</font></div>
<!--<div data-options="region:'west',split:true,title:'文件列表'" style="width:150px;padding:10px;"></div>-->
<div data-options="region:'east',split:true,collapsed:true,title:'East'" style="width:100px;padding:10px;">east region</div>
<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;"></div>
<div data-options="region:'center',title:'文件列表'">
  <table id="dg"></table>
  <div  id="tradeRecoder">
    <div id="filecontent"></div>
  </div>
</div>
</body>
<script>
    $(document).ready(function(){
        $('#dg').datagrid({
            columns:[[
                {field:'fileName',title:'文件名',width:$(this).width()*0.3,align:'center'},
                {field:'operate',title:'操作',width:$(this).width()*0.2,align:'center',
                    formatter: function(value, row, index) {
                        return '<a href="#">查看</a>';
                    }},
                ]],
            url:"/demo/show/filename",
            fit : true,
            fitColumns : true,
            border : false,
            pagination : true,
            pageSize : 10,
            nowrap : false,
            striped : true,
            rownumbers : true,
            singleSelect : true,
            onLoadSuccess : function(){
            }

        });

    });

    $(window).resize(function(){
        $('#dg').datagrid('resize');
    });

    function getFileContent(filename) {
        $("#tradeRecoder").show();
        $('#tradeRecoder').dialog({
            title : '文件内容',
            width : $(this).width()*0.65,
            height : $(this).width()*0.3,
            closed : true,
            cache : false,
        });
        $.ajax({
            async: false,
            type: "POST",
            url: "/demo/show/getContent",
            success: function (result) {
              /*<![CDATA[*/
                 if(result != null && result !="" && result !=undefined){
                    console.log(result);
                    document.getElementById("filecontent").innerHTML= result;
                }else{
                    $.messager.alert('提示',"文件内容为空");
                }
              /*]]>*/
            }
        });

    };
</script>

</html>